	<template>
		<div class="order">

		<!--内容-->
		<div class="order-content">
			<van-tabs v-model="active" swipeable style="">
			<van-tab title="全部订单" >
				<div class="order-alldd">
				<van-list
					v-model="loading1"
					:finished="finished1"
					@load="getOrderList"
				>
					<!--空数据显示-->
					<div style="padding:20px 0;color:#ccc;" v-if="typeof orders == 'string'">
					<i class="iconfont icon-shiliangzhinengduixiang" style="font-size:38px"></i>
					<p>{{orders}}</p>
					</div>

					<div v-else class="order-dfk">
					<div  v-for="(item,index) in orders" :key="index" style="text-align:left;font-size:14px;padding:5px 10px;margin-bottom:10px;background: #fff;">
						<p>
						<!-- 订单{{index+1}} -->{{item.created_at}}
						<span v-if="item.status==0" style="float: right;color:rgb(243, 112, 21);">已取消</span>
						<span v-if="item.status==10" style="float: right;color:rgb(243, 112, 21);">未支付</span>
						<span v-else-if="item.status==20" style="float: right;color:rgb(243, 112, 21);">已支付</span>
						<span v-else-if="item.status==30" style="float: right;color:rgb(243, 112, 21);">已发货</span>
						<span v-else-if="item.status==40" style="float: right;color:rgb(243, 112, 21);">已完成</span>
						</p>
						<div style="display: flex;">
						<img v-if="item.goods[0].item.images" :src="$http.IMGURL+item.goods[0].item.images" style="width:20%;height:60px;" alt="">
						<img v-else src="../../../assets/noimg.jpg" style="width:20%;height:60px;" alt="">
						<div style="height:60px;width:80%;padding:0 5px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;position: relative">
							<p style="margin:2px 0;font-size:14px;color:#000;">{{item.goods[0].item.title}}</p>
							<p style="text-align: left;width:50%;margin:5px 0;font-size:12px;color:#aaa;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
							<span v-for="(v,k,index) in item.goods[0].item.spec_data" :key="index">{{k}}:{{v}} </span>
							</p>
							<p style="position: absolute;bottom:5px;right:10px;">X{{item.goods[0].total}}</p>
						</div>
						</div>
						<div style="text-align: right;">
						小计: <span style="color:rgb(243, 112, 21);">￥{{parseFloat(item.price)+parseFloat(item.freight_fee)}}</span>
						<span style="color:#888;">(含运费{{item.freight_fee}}元)</span>
						</div>
						<!--未支付的按钮-->
						<van-row style="padding:5px 0;" v-if="item.status==0">
						<van-col offset="12" span="12" style="text-align: right;">
							<van-button style="height:auto;line-height:30px;" @click="orderDetail(item.id,item)">查看订单</van-button>
						</van-col>
						</van-row>
						<!--待支付的按钮-->
						<van-row style="padding:5px 0;"  v-else-if="item.status==10">
						<van-col  span="24" style="padding:5px 0;text-align: right;">
							<van-button  style="height:auto;line-height:30px;" @click="orderDetail(item.id,item)">查看订单</van-button>
							<van-button type="danger" style="height:auto;line-height:30px;" @click="payFn(item)">立即付款</van-button>
							<van-button style="height:auto;line-height:30px;" @click="deleteOrderFnMoney(item.id,item)">取消订单</van-button>
						</van-col>
						</van-row>
						<!--已支付的按钮-->
						<van-row style="padding:5px 0;" v-else-if="item.status==20">
						<van-col offset="12" span="12">
							<van-col span="12">
							<van-button  style="height:auto;line-height:30px;">取消订单</van-button>
							</van-col>
							<van-col span="12">
							<van-button type="danger" style="height:auto;line-height:30px;">查看订单</van-button>
							</van-col>
						</van-col>
						</van-row>
						<!--待收货的按钮-->
						<van-row style="padding:5px 0;"  v-else-if="item.status==30">
						<van-col offset="3" span="21">
							<van-col span="7" style="text-align: right">
							<van-button  style="width:100%;height:auto;line-height:30px;" @click="orderDetail(item.id,item)">查看订单</van-button>
							</van-col>
							<van-col span="7"  style="text-align: right">
							<van-button type="danger" style="height:auto;line-height:30px;">查看物流</van-button>
							</van-col>
							<van-col span="7" style="text-align: right">
							<van-button style="height:auto;line-height:30px;">
								确认收货
							</van-button>
							</van-col>
						</van-col>
						</van-row>

						<!--已完成的按钮-->
						<van-row style="padding:5px 0;" v-else-if="item.status==40">
						<van-col offset="10" span="14" style="text-align: right;">
							<van-button style="height:auto;line-height:30px;" @click="orderDetail(item.id,item)">查看订单</van-button>
						</van-col>
						</van-row>
					</div>

					</div>

					<p v-show="block1" style="color:#ccc;">数据已加载完毕！</p>
				</van-list>
				</div>
			</van-tab>
			<van-tab title="待付款"  >

				<van-list
				v-model="loading2"
				:finished="finished2"
				@load="getToBePaid"
				>
				<!--空数据显示-->
				<div style="padding:20px 0;color:#ccc;" v-if="typeof order2 =='string'">
					<i class="iconfont icon-shiliangzhinengduixiang" style="font-size:38px"></i>
					<p>{{order2}}</p>
				</div>

				<div v-else class="order-dfk">
					<div  v-for="(item,index) in order2" :key="index" style="text-align:left;font-size:14px;padding:5px 10px;margin-bottom:10px;background: #fff;">
					<p>
						{{item.created_at}}
						<span  style="float: right;color:rgb(243, 112, 21);">未支付</span>
					</p>
					<div style="display: flex">
						<img v-if="item.goods[0].item.images" :src="$http.IMGURL+item.goods[0].item.images" style="width:20%;height:60px;" alt="">
						<img v-else src="../../../assets/noimg.jpg" style="width:20%;height:60px;" alt="">
						<div style="height:60px;width:80%;padding:0 5px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;position: relative">
						<p style="margin:2px 0;font-size:14px;color:#000;">{{item.goods[0].item.title}}</p>
						<p style="text-align: left;width:50%;margin:5px 0;font-size:12px;color:#aaa;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
							<span v-for="(v,k,index) in item.goods[0].item.spec_data" :key="index">{{k}}:{{v}} </span>
						</p>
						<p style="position: absolute;bottom:5px;right:10px;">X{{item.goods[0].total}}</p>
						</div>
					</div>
					<div style="text-align: right">
						小计: <span style="color:rgb(243, 112, 21);">￥{{parseFloat(item.price)+parseFloat(item.freight_fee)}}</span>
						<span style="color:#888;">(含运费{{item.freight_fee}}元)</span>
					</div>
					<!--待支付的按钮-->
					<van-row style="padding:5px 0;" >
						<van-col  span="24" style="text-align: right;padding:5px 0;">
						<van-button  style="height:auto;line-height:30px;" @click="orderDetail(item.id,item)">查看订单</van-button>
						<van-button type="danger" style="height:auto;line-height:30px;" @click="payFn(item)">立即付款</van-button>
						<van-button style="height:auto;line-height:30px;" @click="deleteOrderFnMoney(item.id,item)">取消订单</van-button>

						</van-col>
					</van-row>

					</div>

				</div>

				<p v-show="block2" style="color:#ccc;">数据已加载完毕！</p>
				</van-list>
			</van-tab>
			<van-tab title="待发货">
				<van-list
				v-model="loading3"
				:finished="finished3"
				@load="pendingDelivery"
				>
				<!--空数据显示-->
				<div style="padding:20px 0;color:#ccc;" v-if="typeof order3 == 'string'">
					<i class="iconfont icon-shiliangzhinengduixiang" style="font-size:38px"></i>
					<p>{{order3}}</p>
				</div>

				<div v-else class="order-dfk">
					<div  v-for="(item,index) in order3" :key="index" style="text-align:left;font-size:14px;padding:5px 10px;margin-bottom:10px;background: #fff;">
					<p>
						{{item.created_at}}
						<span style="float: right;color:rgb(243, 112, 21);">待发货</span>
					</p>
					<div style="display: flex">
						<img v-if="item.goods[0].item.images" :src="$http.IMGURL+item.goods[0].item.images" style="width:20%;height:60px;" alt="">
						<img v-else src="../../../assets/noimg.jpg" style="width:20%;height:60px;" alt="">
						<div style="height:60px;width:80%;padding:0 5px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;position: relative">
						<p style="margin:2px 0;font-size:14px;color:#000;">{{item.goods[0].item.title}}</p>
						<p style="text-align: left;width:50%;margin:5px 0;font-size:12px;color:#aaa;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
							<span v-for="(v,k,index) in item.goods[0].item.spec_data" :key="index">{{k}}:{{v}} </span>
						</p>
						<p style="position: absolute;bottom:5px;right:10px;">X{{item.goods[0].total}}</p>
						</div>
					</div>
					<div style="text-align: right">
						小计: <span style="color:rgb(243, 112, 21);">￥{{parseFloat(item.price)+parseFloat(item.freight_fee)}}</span>
						<span style="color:#888;">(含运费{{item.freight_fee}}元)</span>
					</div>
					<!--已支付的按钮-->
					<van-row style="padding:5px 0;" >
						<van-col  span="24" style="padding:5px 0;text-align: right;">

						<van-button type="danger" style="padding:0 10px;height:auto;line-height:30px;" @click="orderDetail(item.id,item)">查看订单</van-button>
						<van-button style="padding:0 10px;height:auto;line-height:30px;">取消订单</van-button>
						</van-col>
					</van-row>
					</div>

				</div>

				<p v-show="block3" style="color:#ccc;">数据已加载完毕！</p>
				</van-list>
			</van-tab>
			<van-tab title="待收货">
				<!--collectGoods-->
				<van-list
				v-model="loading4"
				:finished="finished4"
				@load="collectGoods"
				>
				<!--空数据显示-->
				<div style="padding:20px 0;color:#ccc;" v-if="typeof order4 == 'string'">
					<i class="iconfont icon-shiliangzhinengduixiang" style="font-size:38px"></i>
					<p>{{order4}}</p>
				</div>

				<div v-else class="order-dfk">
					<div  v-for="(item,index) in order4" :key="index" style="text-align:left;font-size:14px;padding:5px 10px;margin-bottom:10px;background: #fff;">
					<p>
						{{item.created_at}}
						<span  style="float: right;color:rgb(243, 112, 21);">待收货</span>
					</p>
					<div style="display: flex">
						<img v-if="item.goods[0].item.images" :src="$http.IMGURL+item.goods[0].item.images" style="width:20%;height:60px;" alt="">
						<img v-else src="../../../assets/noimg.jpg" style="width:20%;height:60px;" alt="">
						<div style="height:60px;width:80%;padding:0 5px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;position: relative">
						<p style="margin:2px 0;font-size:14px;color:#000;">{{item.goods[0].item.title}}</p>
						<p style="text-align: left;width:50%;margin:5px 0;font-size:12px;color:#aaa;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
							<span v-for="(v,k,index) in item.goods[0].item.spec_data" :key="index">{{k}}:{{v}} </span>
						</p>
						<p style="position: absolute;bottom:5px;right:10px;">X{{item.goods[0].total}}</p>
						</div>
					</div>
					<div style="text-align: right">
						小计: <span style="color:rgb(243, 112, 21);">￥{{parseFloat(item.price)+parseFloat(item.freight_fee)}}</span>
						<span style="color:#888;">(含运费{{item.freight_fee}}元)</span>
					</div>

					<!--待收货的按钮-->
					<van-row style="padding:5px 0;"  >
						<van-col  span="24" style="text-align: right;padding:5px 0;">
						<van-button  style="height:auto;line-height:30px;" @click="orderDetail(item.id,item)">查看订单</van-button>
						<van-button type="danger" style="height:auto;line-height:30px;">查看物流</van-button>
						<van-button style="height:auto;line-height:30px;">
							确认收货
						</van-button>

						</van-col>
					</van-row>
					</div>

				</div>

				<p v-show="block4" style="color:#ccc;">数据已加载完毕！</p>
				</van-list>

			</van-tab>
			<van-tab title="已完成">
				<!--complete-->
				<van-list
				v-model="loading5"
				:finished="finished5"
				@load="complete"
				>
				<!--空数据显示-->
				<div style="padding:20px 0;color:#ccc;" v-if="typeof order5 == 'string'">
					<i class="iconfont icon-shiliangzhinengduixiang" style="font-size:38px"></i>
					<p>{{order5}}</p>
				</div>

				<div v-else class="order-dfk">
					<div  v-for="(item,index) in order5" :key="index" style="text-align:left;font-size:14px;padding:5px 10px;margin-bottom:10px;background: #fff;">
					<p>
						{{item.created_at}}
						<span  style="float: right;color:rgb(243, 112, 21);">已完成</span>
					</p>
					<div style="display: flex">
						<img v-if="item.goods[0].item.images" :src="$http.IMGURL+item.goods[0].item.images" style="width:20%;height:60px;" alt="">
						<img v-else src="../../../assets/noimg.jpg" style="width:20%;height:60px;" alt="">
						<div style="height:60px;width:80%;padding:0 5px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;position: relative">
						<p style="margin:2px 0;font-size:14px;color:#000;">{{item.goods[0].item.title}}</p>
						<p style="text-align: left;width:50%;margin:5px 0;font-size:12px;color:#aaa;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
							<span v-for="(v,k,index) in item.goods[0].item.spec_data" :key="index">{{k}}:{{v}} </span>
						</p>
						<p style="position: absolute;bottom:5px;right:10px;">X{{item.goods[0].total}}</p>
						</div>
					</div>
					<div style="text-align: right">
						小计: <span style="color:rgb(243, 112, 21);">￥{{parseFloat(item.price)+parseFloat(item.freight_fee)}}</span>
						<span style="color:#888;">(含运费{{item.freight_fee}}元)</span>
					</div>

					<!--待收货的按钮-->
					<van-row style="padding:5px 0;" >
						<van-col  span="24" style="padding:5px 0;text-align: right">
						<van-button type="danger" style="padding:0 10px;height:auto;line-height:30px;" @click="orderDetail(item.id,item)">
							查看订单
						</van-button>
						</van-col>
					</van-row>
					</div>

				</div>

				<p v-show="block5" style="color:#ccc;">数据已加载完毕！</p>
				</van-list>
			</van-tab>
			<van-tab title="已关闭">
				<!--getCloseOrder-->
				<van-list
				v-model="loading6"
				:finished="finished6"
				@load="getCloseOrder"
				>
				<div  style="padding:20px 0;color:#ccc;" v-if="typeof closeOrder == 'string'">
					<i class="iconfont icon-shiliangzhinengduixiang" style="font-size:38px"></i>
					<p>{{closeOrder}}</p>
				</div>

				<div v-else class="order-dfk">
					<div  v-for="(item,index) in closeOrder" :key="index" style="text-align:left;font-size:14px;padding:5px 10px;margin-bottom:10px;background: #fff;">
					<p>
						{{item.created_at}}
						<span  style="float: right;color:rgb(243, 112, 21);">已关闭</span>
					</p>
					<div style="display: flex">
						<img v-if="item.goods[0].item.images" :src="$http.IMGURL+item.goods[0].item.images" style="width:20%;height:60px;" alt="">
						<img v-else src="../../../assets/noimg.jpg" style="width:20%;height:60px;" alt="">
						<div style="height:60px;width:80%;padding:0 5px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;position: relative">
						<p style="margin:2px 0;font-size:14px;color:#000;">{{item.goods[0].item.title}}</p>
						<p style="text-align: left;width:50%;margin:5px 0;font-size:12px;color:#aaa;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
							<span v-for="(v,k,index) in item.goods[0].item.spec_data" :key="index">{{k}}:{{v}} </span>
						</p>
						<p style="position: absolute;bottom:5px;right:10px;">X{{item.goods[0].total}}</p>
						</div>
					</div>
					<div style="text-align: right">
						小计: <span style="color:rgb(243, 112, 21);">￥{{parseFloat(item.price)+parseFloat(item.freight_fee)}}</span>
						<span style="color:#888;">(含运费{{item.freight_fee}}元)</span>
					</div>

					<!--已关闭的按钮-->
					<van-row style="padding:5px 0;" >
						<van-col offset="12" span="12" style="text-align: right;">
						<van-button style="height:auto;line-height:30px;" @click="orderDetail(item.id,item)">查看订单</van-button>
						</van-col>
					</van-row>
					</div>

				</div>

				<p v-show="block6" style="color:#ccc;">数据已加载完毕！</p>
				</van-list>
			</van-tab>
			</van-tabs>
		</div>
		</div>
	</template>

	<script>
	import { mapState } from 'vuex';
	import axios from 'axios';
		export default {
			name: "order",
		data(){
			return {
				active:1,
				list:['全部订单','待付款','代发货','待收货','已完成','已关闭'],
				orders:[],//所有订单列表
				loading1: false,
				finished1: false,
				block1:false,
				page:1,
				pagesize:10,
				total:0,

				//待支付的订单
				order2:[],
				order2Status:0,
				loading2: false,
				finished2: false,
				block2:false,
				page2:1,
				pagesize2:10,
				total2:0,

				//待发货
				order3:[],
				order3Status:0,
				loading3: false,
				finished3: false,
				block3:false,
				page3:1,
				pagesize3:10,

				//待收货
				order4:[],
				order4Status:0,
				loading4: false,
				finished4: false,
				block4:false,
				page4:1,
				pagesize4:10,
				//已完成
				order5:[],
				order5Status:0,
				loading5: false,
				finished5: false,
				block5:false,
				page5:1,
				pagesize5:10,

				//已关闭的的订单
				closeOrder:[],//已关闭的订单
				closeOrderStatus:0,
				loading6: false,
				finished6: false,
				block6:false,
				page6:1,
				pagesize6:10,
				total6:0,

			}
		},
		computed: {
			...mapState('shop',{
				datas:'data',
				order:"order",
				sever:'sever'
			})
		},
		watch:{
			active(val){
			// this.order.active = val
			if(val==0){

			}else if(val == 1){
				// if(!this.order2Status){
				//   this.getToBePaid();
				// }
			}else if(val == 2){

			}else if(val == 3){

			}else if(val == 4){//已关闭的订单
				if(!this.closeOrderStatus) {
					this.getCloseOrder()
				}
			}
			}
		},
		methods: {
			onClickLeft(){
			this.$router.go(-1);
			},
			//查询所有订单
			getOrderList(){
			var $this = this;
			this.$http.order.get('shop/myorder',{
				params:{
				page: $this.page,
				pagesize:$this.pagesize,
				pay_type:'',
				status:'',
				datetype:0,
				start_time:'',
				end_time:'',
				keyword:'',
				}
			})
				.then((res)=>{
				// console.log(res.data.data.data)
				if(!res.data.code){
					$this.page=res.data.data.current_page+1;
					//总人数
					$this.total=res.data.data.total;
					var discount = $this.getCookie('discount');
					for(var i =0;i<res.data.data.data.length;i++){
					res.data.data.data[i].xiaoji = ''
					$this.orders.push(res.data.data.data[i]);
					}

					$this.loading1 = false;
					if(!$this.orders.length){
					$this.finished1 = true;
					$this.orders = '您还没有相关订单！';
					}else if ($this.orders.length >= res.data.data.total) {
					$this.finished1 = true;
					$this.block1 = true
					}
					// console.log($this.orders)
				}

				}).catch((err)=>{
				console.log(err)
			})
			},
			//查询待支付的订单
			getToBePaid(){
			var $this = this;
			this.$http.order.get('shop/myorder',{
				params:{
				page: $this.page2,
				pagesize:$this.pagesize2,
				pay_type:0,
				status:10,//10表示待支付
				datetype:0,
				start_time:'',
				end_time:'',
				keyword:'',
				}
			})
				.then((res)=>{
				// console.log(res.data.data)
				if(!res.data.code){
					$this.order2Status = 1;
					$this.page2=res.data.data.current_page+1;
					//总人数
					$this.total2=res.data.data.total;
					for(var i =0;i<res.data.data.data.length;i++){
					$this.order2.push(res.data.data.data[i]);
					}

					$this.loading2 = false;
					if(!$this.order2.length){
					$this.finished2 = true;
					$this.order2 = '您还没有相关订单！';
					}else if ($this.order2.length >= res.data.data.total) {
					$this.finished2 = true;
					$this.block2 = true
					}
					// console.log($this.orders2)
				}

				}).catch((err)=>{
				console.log(err)
			})
			},
			//查询待发货的订单
			pendingDelivery(){
			var $this = this;
			this.$http.order.get('shop/myorder',{
				params:{
				page: $this.page3,
				pagesize:$this.pagesize3,
				pay_type:0,
				status:20,//20表示已支付,待发货
				datetype:0,
				start_time:'',
				end_time:'',
				keyword:'',
				}
			})
				.then((res)=>{
				// console.log(res.data.data)
				if(!res.data.code){
					$this.order3Status = 1;
					$this.page3=res.data.data.current_page+1;

					for(var i =0;i<res.data.data.data.length;i++){
					$this.order3.push(res.data.data.data[i]);

					}

					$this.loading3 = false;
					if(!$this.order3.length){
					$this.finished3 = true;
					$this.order3 = '您还没有相关订单！';
					}else if ($this.order3.length >= res.data.data.total) {
					$this.finished3 = true;
					$this.block3 = true
					}
					// console.log($this.orders2)
				}

				}).catch((err)=>{
				console.log(err)
			})
			},
			//查询待收货的订单
			collectGoods(){
			var $this = this;
			this.$http.order.get('shop/myorder',{
				params:{
				page: $this.page4,
				pagesize:$this.pagesize4,
				pay_type:0,
				status:30,//30表示已发货
				datetype:0,
				start_time:'',
				end_time:'',
				keyword:'',
				}
			})
				.then((res)=>{
				// console.log(res.data.data)
				if(!res.data.code){
					$this.order4Status = 1;
					$this.page4=res.data.data.current_page+1;

					for(var i =0;i<res.data.data.data.length;i++){
					$this.order4.push(res.data.data.data[i]);

					}

					$this.loading4 = false;
					if(!$this.order4.length){
					$this.finished4 = true;
					$this.order4 = '您还没有相关订单！';
					}else if ($this.order4.length >= res.data.data.total) {
					$this.finished4 = true;
					$this.block4 = true
					}
					// console.log($this.orders2)
				}

				}).catch((err)=>{
				console.log(err)
			})
			},
			//查询已完成的订单
			complete(){
			var $this = this;
			this.$http.order.get('shop/myorder',{
				params:{
				page: $this.page5,
				pagesize:$this.pagesize5,
				pay_type:0,
				status:40,//40表示已完成
				datetype:0,
				start_time:'',
				end_time:'',
				keyword:'',
				}
			})
				.then((res)=>{
				// console.log(res.data.data)
				if(!res.data.code){
					$this.order5Status = 1;
					$this.page5=res.data.data.current_page+1;

					for(var i =0;i<res.data.data.data.length;i++){
					$this.order5.push(res.data.data.data[i]);
					}

					$this.loading5 = false;
					if(!$this.order5.length){
					$this.finished5 = true;
					$this.order5 = '您还没有相关订单！';
					}else if ($this.order5.length >= res.data.data.total) {
					$this.finished5 = true;
					$this.block5 = true
					}
					// console.log($this.orders2)
				}

				}).catch((err)=>{
				console.log(err)
			})
			},
			//查询已关闭的订单
			getCloseOrder(){
			var $this = this;
			this.$http.order.get('shop/myorder',{
				params:{
				page: $this.page6,
				pagesize:$this.pagesize6,
				pay_type:'',
				status:0,
				datetype:0,
				start_time:'',
				end_time:'',
				keyword:'',
				}
			})
				.then((res)=>{
				if(!res.data.code){
					$this.closeOrderStatus = 1;

					$this.page6=res.data.data.current_page+1;
					//总人数
					$this.total6=res.data.data.total;
					for(var i =0;i<res.data.data.data.length;i++){
					$this.closeOrder.push(res.data.data.data[i]);

					}

					$this.loading6 = false;
					if(!$this.closeOrder.length){
					$this.finished6 = true;
					$this.closeOrder = '您还没有相关订单！';
					}else if ($this.closeOrder.length >= res.data.data.total) {
					$this.finished6 = true;
					$this.block6 = true
					}
				}
				}).catch((err)=>{
				console.log(err)
			})
			},
			// 取消订单
			deleteOrderFnMoney(idx,obj){
			// console.log(obj)
			this.$dialog.confirm({
				title: '取消',
				message: '确认取消该条商品吗？'
			}).then(() => {
        this.$http.order.delete('/shop/order/'+idx)
				.then((res)=>{
					// console.log(res.data);
					if(!res.data.code){

					this.$toast.success('取消订单成功');

					obj.status = 0;

					// this.getToBePaid()
					// this.getOrderList()
					}else{
					this.$toast(res.data.message);
					}
				}).catch((err)=>{
				this.$toast(err.message);
				})

			}).catch(() => {
				// on cancel

			});
			},
			//删除已完成的订单
			deleteOrderFnOver(){
			this.$dialog.confirm({
				title: '删除',
				message: '确认删除该条商品吗？'
			}).then(() => {
				// on confirm
				this.$toast.success('删除成功');
			}).catch(() => {
				// on cancel
			});
			},
			// 订单详情
			orderDetail(idx,obj){
			// console.log(idx,obj)
			this.$router.push({name:'shop_orderinfo',params:{
					order_id:idx,
					obj:obj
				}
			})
			},
			//跳转物流
			logisticsFn(){
			this.$router.push({name:'logistics',params:{
				id:0
				}
			})
			},
			//获取cookie
			getCookie (cname) {
			var name = cname + "=";
			var ca = document.cookie.split(';');
			for (var i = 0; i < ca.length; i++) {
				var c = ca[i];
				while (c.charAt(0) == ' ') c = c.substring(1);
				if (c.indexOf(name) != -1){
				return c.substring(name.length, c.length);
				}
			}
			return "";
			},
			//立即付款
			payFn(con){
				console.log(con.id)
				this.$router.push({ name: "shop_pay",params:{id:con.id}});
			}
		},
		mounted(){
			this.$toast.loading({
			mask: true,
			message: '加载中...',
			duration: 1000
			});
			this.active = this.$route.params.active;
		}
		}
	</script>

	<style>
	.order-header .van-nav-bar__text{
	color:#FF8855!important;
	}
	.order-dfk{
		padding:5px 0;
	}
	.order-dfh,.order-ywc{
		padding:5px;
	}
	.van-tabs__content{
		text-align: center
	}
	</style>
